﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace DevelopTools.UI
{
    public class TextAllControl : MonoBehaviour
    {
        public GameObject[] allUIs;
        public static TextAllControl instance;
        ClickButtonShowUI[] mClickButtonShowUIs;

        public List<ObjMove> objMoves = new List<ObjMove>();
        // Use this for initialization
        void Start()
        {
            instance = this;
            mClickButtonShowUIs = new ClickButtonShowUI[allUIs.Length];
            for (int i = 0; i < mClickButtonShowUIs.Length; ++i)
            {
                mClickButtonShowUIs[i] = allUIs[i].GetComponent<ClickButtonShowUI>();
            }

        }


        // Update is called once per frame
        void Update()
        {
            //for(int i=0;i< objMoves.Count;++i)
            //{
            //    if(objMoves[i].mMoveState==MoveState.stayForward)
            //    {
            //        allUIs[i].SetActive(true); 
            //    }
            //    else
            //    {
            //        allUIs[i].SetActive(false);
            //    }

            //}

        }

        public void SetUIActive(int index)
        {
            for (int i = 0; i < allUIs.Length; ++i)
            {
                allUIs[index].SetActive(false);

            }
            allUIs[index].SetActive(true);
        }

        public void SetUIActive(int index, bool active)
        {
            for (int i = 0; i < allUIs.Length; ++i)
            {
                allUIs[i].SetActive(!active);
            }
            allUIs[index].SetActive(active);
        }

        public void SetUIAllActiveFalse()
        {
            for (int i = 0; i < allUIs.Length; ++i)
            {
                allUIs[i].SetActive(false);
            }

        }
    }
}